import axios from 'axios'
const apiUrl = process.env.API
const api = {
  test: () => {
    console.log(apiUrl)
    return axios.get(apiUrl + 'dataview/index')
  },

  project1Index: () => {
    return axios.post(apiUrl + 'culture/index')
  },

  getHeart: () => {
    return axios.post(apiUrl + 'jt/index')
  },

  chooseSchool: (type, cid) => {
    return axios({
      method: 'post',
      url: apiUrl + 'list',
      data: {
        type: type,
        cid: cid
      }
    })
  },

  getChinaId: () => {
    return axios.post(apiUrl + 'jt/love')
  },

  project3Index: () => {
    return axios.post(apiUrl + 'science/index')
  },

  project4Index: () => {
    return axios.post(apiUrl + 'front/index')
  },

  articleList: (type, id) => {
    return axios({
      method: 'post',
      url: apiUrl + 'list',
      data: {
        type: type,
        id: id
      }
    })
  },

  articleDetail: (id) => {
    return axios({
      method: 'post',
      url: apiUrl + 'article/detail',
      data: {
        id: id
      }
    })
  }
}

export default api
